﻿using System;

namespace SessionHunter.Business.Exceptions
{
    /// <summary>
    /// This exception is thrown when we have a case/if statement and there is something we didn't plan for
    /// </summary>
    [Serializable]
    public class UnhandledCaseException : ApplicationException
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="UnhandledCaseException"/> class.
        /// </summary>
        public UnhandledCaseException() { }
        /// <summary>
        /// Initializes a new instance of the <see cref="UnhandledCaseException"/> class.
        /// </summary>
        /// <param name="failedValue">The value we tried to set it to</param>
        public UnhandledCaseException(string failedValue) : base("Unhandled case: " + failedValue) { }
        /// <summary>
        /// Initializes a new instance of the <see cref="UnhandledCaseException"/> class.
        /// </summary>
        /// <param name="failedValue">The value we tried to set it to</param>
        public UnhandledCaseException(Enum failedValue) : base("Unhandled case: " + failedValue.ToString()) { }
        /// <summary>
        /// Initializes a new instance of the <see cref="UnhandledCaseException"/> class.
        /// </summary>
        /// <param name="failedValue">The value we tried to set it to</param>
        /// <param name="inner">The inner exception.</param>
        public UnhandledCaseException(string failedValue, Exception inner) : base("Unhandled case: " + failedValue, inner) { }
        /// <summary>
        /// Initializes a new instance of the <see cref="UnhandledCaseException"/> class.
        /// </summary>
        /// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
        /// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"/> that contains contextual information about the source or destination.</param>
        /// <exception cref="T:System.ArgumentNullException">The <paramref name="info"/> parameter is null. </exception>
        ///   
        /// <exception cref="T:System.Runtime.Serialization.SerializationException">The class name is null or <see cref="P:System.Exception.HResult"/> is zero (0). </exception>
        protected UnhandledCaseException(
          System.Runtime.Serialization.SerializationInfo info,
          System.Runtime.Serialization.StreamingContext context)
            : base(info, context) { }
    }
}
